<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>

    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{lib/css/main.css}">
    <link rel="stylesheet" th:href="@{/lib/css/public.css}">

    <script th:src="@{/lib/js/jquery-3.4.1.min.js}"></script>
    <script th:src="@{/layui/layui.js}"></script>
    <!--<script th:src="@{/lib/js/allstudent.js}"></script>-->



</head>




<body>
<!--<div th:replace="menu/left :: leftbar" ></div>-->
<!--<div th:replace="menu/top :: topbar"></div>-->


<div class="table">
    <h2 class="tablename">个人信息</h2>
    <hr class="layui-bg-gray">
    <table class="layui-hide" id="demo" lay-filter="test"></table>


    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <!--<form class="layui-form layui-col-space5">-->
                        <!--<div class="layui-inline layui-show-xs-block">-->
                        <!--<input class="layui-input"  autocomplete="off" placeholder="开始日" name="start" id="start">-->
                        <!--</div>-->
                        <!--<div class="layui-inline layui-show-xs-block">-->
                        <!--<input class="layui-input"  autocomplete="off" placeholder="截止日" name="end" id="end">-->
                        <!--</div>-->


                    </div>
                    <!--<div class="layui-card-header">-->
                    <!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>-->
                    <!--<button class="layui-btn" onclick="xadmin.open('添加用户','./admin-add.html',600,400)"><i class="layui-icon"></i>添加</button>-->
                    <!--</div>-->
                    <div class="layui-card-body ">
                        <table class="layui-table layui-form">
                            <thead>
                            <tr>


                                <th>姓名</th>
                                <th>性别</th>
                                <th>手机号</th>
                                <th>擅长饲养</th>
                                <th>价格</th>
                                <th>操作</th>
                            </thead>
                            <tbody>

                                <tr>

                                        <input type="hidden" id="id" th:value="${info.id}"/>


                                    <td>
                                        <input id="name" th:value="${info.name}"/>
                                    </td>
                                    <td>
                                        <input id="sex" th:value="${info.sex}"/>
                                    </td>
                                    <td>
                                        <input id="phone" th:value="${info.phone}"/>
                                    </td>

                                    <td>
                                        <input id="shanchang" th:value="${info.shanchang}"/>
                                    </td>

                                    <td>
                                        <input id="price" th:value="${info.price}"/>
                                    </td>

                                    <td>
                                        <button onclick="xiugai()">修改</button>
                                        <!--<a title="编辑"  onclick="xadmin.open('编辑','admin-edit.html')" href="javascript:;">-->
                                        <!--<i class="layui-icon">&#xe642;</i>-->
                                        <!--</a>-->
                                        <!--<a title="删除" th:onclick="|javascript:shanchu('${j.id}')|" href="javascript:;">-->
                                            <!--<i class="layui-icon">&#xe640;</i>-->
                                        <!--</a>-->
                                    </td>
                                </tr>

                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>
    </div>

</div>
<script>
    function xiugai(){
       var id = $("#id").val()
      var name =  $("#name").val()
        var sex =  $("#sex").val()
        var shanchang =  $("#shanchang").val()
        var price =  $("#price").val()
        var phone =  $("#phone").val()

        $.ajax({
            url:"/xiugai",
            data:{"id":id,"name":name,"sex":sex,"shanchang":shanchang,"price":price,"phone":phone},
            success:function(data){
                if(data == 1){
                    alert("修改成功！")
                    location.reload()
                }
            },
            error:function(){
                alert("系统内部异常！")
            }
        })
    }

</script>


</body>

</html>